from django.contrib import admin

from .models import PowerSupplyModel, NetworkDeviceModel, AccessoriesModel, SeismicEquipmentModel, \
    SeismicEquipmentEntity, EquipmentList, EquipmentItem


@admin.register(PowerSupplyModel, NetworkDeviceModel, AccessoriesModel)
class EquipmentModelAdmin(admin.ModelAdmin):
    list_display = ('brand', 'name', 'feature', 'type',)
    list_filter = ('type',)
    search_fields = ('brand', 'name', 'feature',)
    fields = ('type', 'brand', 'name', 'feature', 'remark', 'total_quantity', 'online_quantity', 'instock_quantity',
              'damage_quantity', 'lend_quantity')


@admin.register(SeismicEquipmentModel)
class SeismicEquipmentModelAdmin(admin.ModelAdmin):
    list_display = ('brand', 'name', 'feature', 'type',)
    list_filter = ('type',)
    search_fields = ('brand', 'name', 'feature',)
    fields = ('type', 'brand', 'name', 'feature', 'remark', 'total_quantity', 'online_quantity',
              'instock_quantity', 'damage_quantity', 'lend_quantity')


@admin.register(SeismicEquipmentEntity)
class SeismicEquipmentEntityAdmin(admin.ModelAdmin):
    list_display = ('sn', 'model', 'status',)


admin.site.register(EquipmentList)
admin.site.register(EquipmentItem)

admin.site.site_header = '流动台站维护日志管理系统 | 后台'
